* {
    padding: 0;
    margin: 0;
    text-decoration: none;
}

/*注意：设计稿为宽度:750px==100vw;
宽度格式则为设局图尺寸（px)/7.5vw(750/100vw = 1%vw)

//定义全局变量开始
//定义换算单位；直接输入设计图尺寸即可
*/
@px: 7.5vw;

.box {
    box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    border-radius: 10px;
    background: #e9edf2;
    //头部
    .header {
        height: 50px;
        border-top-left-radius: 25px;
        border-top-right-radius: 25px;
        background: #2e4afe;

        h3 {
            text-align: center;
            color: #fff;
            font-size: 18px;
            line-height: 50px;
        }
        #addressee_name{
            font-size: 20px;
        }
    }

    //聊天窗口
    .chat_window {
        background: #ecf3fd;
        padding-top: 10px;
        padding-bottom: 35px;
        border-bottom: 1px solid #2ecefe;
        width: 100%;
        height: calc(100vh - 215px);
        overflow-y: scroll;
        /* 去掉滚动条 */
        //overflow: auto;
        //-ms-overflow-style: none; /* IE 10+ */
        //overflow: -moz-scrollbars-none; /* Firefox */

        //滚动条样式
        overflow-y: scroll; /* 重新启用垂直滚动条 */
        -ms-overflow-style: none; /* IE 10+ 隐藏默认滚动条 */
        scrollbar-width: thin; /* Firefox 隐藏默认滚动条 */

        #addressee_name {
            display: inline-block;
            width: 100%;
            text-align: center;
            margin: 0 auto;
            font-size: 15px;
            color: rgba(95, 92, 92, 0.65);
        }

        //对话记录
        .msg_box {
            margin-bottom: 2px;
            display: flex;
            align-items: stretch;

            .pic {
                margin-top: 5px;
                padding: 0 15px;
                display: flex;
                flex-direction: column;
                align-items: center;

                img {
                    width: 32px;
                    height: 32px;
                    border: 1px solid #c7c7c7;
                    border-radius: 50%;
                }

                span {
                    font-size: 10px;
                    color: #9c9c9c;
                }
            }

            .msg {
                margin-bottom: 15px;
                display: flex;
                flex-direction: column;
                //用户昵称
                .user {
                    span {
                        display: inline-block;
                        width: 150px;
                        text-align: left;
                        font-size: 12px;
                        color: #7a7b7f;

                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }
                }

                //聊天内容
                .chat_box {
                    display: flex;
                    justify-content: flex-start;
                    p {
                        background: #fefffe;
                        color: #7a7b7f;
                        word-break: break-all;
                        border-radius: 10px;
                        padding: 5px;
                        max-width: 60vw;
                        min-height: 13px;
                        font-size: 13px;
                    }

                    a {
                        img {
                            width: 80px;
                            height: 80px;
                            object-fit: contain;
                            object-position: center;
                        }
                    }
                    //附件
                    .file_box {
                        padding: (20/@px) (25/@px);
                        border-radius: 10px;
                        background: #fefffe;
                        width: 50vw;
                        display: flex;
                        flex-direction: row;
                        justify-content: space-between;
                        align-items: center;
                        div{
                            width: 80%;
                            display: flex;
                            flex-direction: column;
                            p{
                                padding: 0;
                                color: #7a7b7f;
                                font-size: 13px;

                                white-space:nowrap;
                                overflow:hidden;
                                text-overflow:ellipsis;
                            }
                            span{
                                color: #7a7b7f;
                                font-size: 13px;
                            }
                        }
                        img {
                            width: (80/@px);
                            height: (80/@px);
                            object-fit: contain;
                            object-position: center;
                        }
                    }

                    .a_link {
                        border: 1px solid #d9d9d9;
                        padding: 8px;
                        border-radius: 7px;
                        background: #f7f7f7;
                        width: 50%;
                        display: flex;
                        align-items: center;

                        img {
                            width: 50px;
                            height: 50px;
                        }

                        div {
                            width: 60%;
                            margin-left: 10px;
                            display: flex;
                            flex-direction: column;
                            font-size: 12px;

                            span:nth-child(1) {
                                color: #333333;
                                font-size: 13px;
                                margin-bottom: 7px;
                            }

                            span {
                                color: #8c8c8c;
                                font-size: 10px;
                                white-space: nowrap;
                                overflow: hidden;
                                text-overflow: ellipsis;
                            }
                        }
                    }
                }
            }
        }

        .right_msg_box {
            display: flex;
            justify-content: flex-end;

            .msg {
                display: flex;
                justify-content: flex-end;

                .user {
                    span {
                        text-align: right;
                    }
                }
                .chat_box {
                    display: flex;
                    justify-content: flex-end;
                }
            }
        }
    }
}

/* 去掉滚动条 */
//.chat_window::-webkit-scrollbar {
//    width: 0 !important
//}

/* Webkit 浏览器中的滚动条样式 */
.chat_window::-webkit-scrollbar {
    width: 15px; /* 设置滚动条宽度 */
}

.chat_window::-webkit-scrollbar-track {
    background: #f1f1f1; /* 滚动条轨道背景色 */
    border-radius: 10px; /* 圆角边框 */
}

.chat_window::-webkit-scrollbar-thumb {
    background: #888; /* 滚动条拇指（滑块）背景色 */
    border-radius: 10px; /* 圆角边框 */
}

.chat_window::-webkit-scrollbar-thumb:hover {
    background: #555; /* 滚动条拇指（滑块）鼠标悬停时背景色 */
}

/* Firefox 中的滚动条样式 */
.chat_window {
    scrollbar-color: #888 #f1f1f1; /* 设置滚动条颜色（拇指和轨道） */
    scrollbar-width: thin; /* 设置滚动条宽度为较细 */
}


//输入
.input_box {
    background: #feffff;
    position: fixed;
    bottom: 0px;
    width: 100%;

    .button_box {
        padding: 8px 10px 0px;
        a {
            margin-right: (15/@px);
            img {
                width: 22px;
                height: 22px;
            }
        }

        //表情
        .emoji_a {
            .emoji_box {
                border: 1px dashed #5F5C5CA5;
                display: none;

                button {
                    margin-left: auto; // 将按钮推到右边
                    padding: (0/@px) (10/@px);
                    display: flex;
                }

                #emoji_div {
                }
            }
        }
    }

    //文本域输入框
    textarea {
        background: #feffff;
        border: 0px solid;
        padding: 10px;
        width: 90%;
        min-height: 60px;
        resize: vertical;
    }

    //发送按钮
    .send_button {
        //border-top: 1px dashed rgba(95, 92, 92, 0.65);
        padding: 8px;
        display: flex;
        justify-content: flex-end;

        #send_btn {
            padding: (10/@px) (30/@px);
            border: 0;
            border-radius: (8/@px);
            background: #e9e9e9;
            color: #52a9fe;
            font-size: (25/@px);
        }
    }
}

//方法图片容器
#open_chat_img_box {
    position: fixed;
    top: 0;
    width: 100%;
    height: 100vh;
    z-index: 10;
    display: none;
    background: rgba(0, 0, 0, 0.8);
    
    &_img {
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        
        img {
            width: 100%;
        }
    }
}



